Optimal. Leaf size=404 \[ -\frac {2 c d x \, _2F_1\left (1,\frac {1}{n};1+\frac {1}{n};-\frac {2 c x^n}{b-\sqrt {b^2-4 a c}}\right )}{b^2-4 a c-b \sqrt {b^2-4 a c}}-\frac {2 c d x \, _2F_1\left (1,\frac {1}{n};1+\frac {1}{n};-\frac {2 c x^n}{b+\sqrt {b^2-4 a c}}\right )}{b^2-4 a c+b \sqrt {b^2-4 a c}}-\frac {c e x^2 \, _2F_1\left (1,\frac {2}{n};\frac {2+n}{n};-\frac {2 c x^n}{b-\sqrt {b^2-4 a c}}\right )}{b^2-4 a c-b \sqrt {b^2-4 a c}}-\frac {c e x^2 \, _2F_1\left (1,\frac {2}{n};\frac {2+n}{n};-\frac {2 c x^n}{b+\sqrt {b^2-4 a c}}\right )}{b^2-4 a c+b \sqrt {b^2-4 a c}}-\frac {2 c f x^3 \, _2F_1\left (1,\frac {3}{n};\frac {3+n}{n};-\frac {2 c x^n}{b-\sqrt {b^2-4 a c}}\right )}{3 \left (b^2-4 a c-b \sqrt {b^2-4 a c}\right )}-\frac {2 c f x^3 \, _2F_1\left (1,\frac {3}{n};\frac {3+n}{n};-\frac {2 c x^n}{b+\sqrt {b^2-4 a c}}\right )}{3 \left (b^2-4 a c+b \sqrt {b^2-4 a c}\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.19, antiderivative size = 404, normalized size of antiderivative = 1.00, number of steps
used = 11, number of rules used = 4, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.148, Rules used = {1807, 1907,
251, 371} \begin {gather*} -\frac {2 c d x \, _2F_1\left (1,\frac {1}{n};1+\frac {1}{n};-\frac {2 c x^n}{b-\sqrt {b^2-4 a c}}\right )}{-b \sqrt {b^2-4 a c}-4 a c+b^2}-\frac {2 c d x \, _2F_1\left (1,\frac {1}{n};1+\frac {1}{n};-\frac {2 c x^n}{b+\sqrt {b^2-4 a c}}\right )}{b \sqrt {b^2-4 a c}-4 a c+b^2}-\frac {c e x^2 \, _2F_1\left (1,\frac {2}{n};\frac {n+2}{n};-\frac {2 c x^n}{b-\sqrt {b^2-4 a c}}\right )}{-b \sqrt {b^2-4 a c}-4 a c+b^2}-\frac {c e x^2 \, _2F_1\left (1,\frac {2}{n};\frac {n+2}{n};-\frac {2 c x^n}{b+\sqrt {b^2-4 a c}}\right )}{b \sqrt {b^2-4 a c}-4 a c+b^2}-\frac {2 c f x^3 \, _2F_1\left (1,\frac {3}{n};\frac {n+3}{n};-\frac {2 c x^n}{b-\sqrt {b^2-4 a c}}\right )}{3 \left (-b \sqrt {b^2-4 a c}-4 a c+b^2\right )}-\frac {2 c f x^3 \, _2F_1\left (1,\frac {3}{n};\frac {n+3}{n};-\frac {2 c x^n}{b+\sqrt {b^2-4 a c}}\right )}{3 \left (b \sqrt {b^2-4 a c}-4 a c+b^2\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 251
Rule 371
Rule 1807
Rule 1907
Rubi steps
\begin {align*} \int \frac {d+e x+f x^2}{a+b x^n+c x^{2 n}} \, dx &=\frac {(2 c) \int \frac {d+e x+f x^2}{b-\sqrt {b^2-4 a c}+2 c x^n} \, dx}{\sqrt {b^2-4 a c}}-\frac {(2 c) \int \frac {d+e x+f x^2}{b+\sqrt {b^2-4 a c}+2 c x^n} \, dx}{\sqrt {b^2-4 a c}}\\ &=\frac {(2 c) \int \left (-\frac {d}{-b+\sqrt {b^2-4 a c}-2 c x^n}-\frac {e x}{-b+\sqrt {b^2-4 a c}-2 c x^n}-\frac {f x^2}{-b+\sqrt {b^2-4 a c}-2 c x^n}\right ) \, dx}{\sqrt {b^2-4 a c}}-\frac {(2 c) \int \left (\frac {d}{b+\sqrt {b^2-4 a c}+2 c x^n}+\frac {e x}{b+\sqrt {b^2-4 a c}+2 c x^n}+\frac {f x^2}{b+\sqrt {b^2-4 a c}+2 c x^n}\right ) \, dx}{\sqrt {b^2-4 a c}}\\ &=-\frac {(2 c d) \int \frac {1}{-b+\sqrt {b^2-4 a c}-2 c x^n} \, dx}{\sqrt {b^2-4 a c}}-\frac {(2 c d) \int \frac {1}{b+\sqrt {b^2-4 a c}+2 c x^n} \, dx}{\sqrt {b^2-4 a c}}-\frac {(2 c e) \int \frac {x}{-b+\sqrt {b^2-4 a c}-2 c x^n} \, dx}{\sqrt {b^2-4 a c}}-\frac {(2 c e) \int \frac {x}{b+\sqrt {b^2-4 a c}+2 c x^n} \, dx}{\sqrt {b^2-4 a c}}-\frac {(2 c f) \int \frac {x^2}{-b+\sqrt {b^2-4 a c}-2 c x^n} \, dx}{\sqrt {b^2-4 a c}}-\frac {(2 c f) \int \frac {x^2}{b+\sqrt {b^2-4 a c}+2 c x^n} \, dx}{\sqrt {b^2-4 a c}}\\ &=-\frac {2 c d x \, _2F_1\left (1,\frac {1}{n};1+\frac {1}{n};-\frac {2 c x^n}{b-\sqrt {b^2-4 a c}}\right )}{b^2-4 a c-b \sqrt {b^2-4 a c}}-\frac {2 c d x \, _2F_1\left (1,\frac {1}{n};1+\frac {1}{n};-\frac {2 c x^n}{b+\sqrt {b^2-4 a c}}\right )}{b^2-4 a c+b \sqrt {b^2-4 a c}}-\frac {c e x^2 \, _2F_1\left (1,\frac {2}{n};\frac {2+n}{n};-\frac {2 c x^n}{b-\sqrt {b^2-4 a c}}\right )}{b^2-4 a c-b \sqrt {b^2-4 a c}}-\frac {c e x^2 \, _2F_1\left (1,\frac {2}{n};\frac {2+n}{n};-\frac {2 c x^n}{b+\sqrt {b^2-4 a c}}\right )}{b^2-4 a c+b \sqrt {b^2-4 a c}}-\frac {2 c f x^3 \, _2F_1\left (1,\frac {3}{n};\frac {3+n}{n};-\frac {2 c x^n}{b-\sqrt {b^2-4 a c}}\right )}{3 \left (b^2-4 a c-b \sqrt {b^2-4 a c}\right )}-\frac {2 c f x^3 \, _2F_1\left (1,\frac {3}{n};\frac {3+n}{n};-\frac {2 c x^n}{b+\sqrt {b^2-4 a c}}\right )}{3 \left (b^2-4 a c+b \sqrt {b^2-4 a c}\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(834\) vs. \(2(404)=808\).
time = 0.87, size = 834, normalized size = 2.06 \begin {gather*} \frac {x \left (2 f x^2 \left (\left (-b^2+4 a c-b \sqrt {b^2-4 a c}\right ) \left (1-\left (\frac {x^n}{-\frac {-b+\sqrt {b^2-4 a c}}{2 c}+x^n}\right )^{-3/n} \, _2F_1\left (-\frac {3}{n},-\frac {3}{n};\frac {-3+n}{n};\frac {b-\sqrt {b^2-4 a c}}{b-\sqrt {b^2-4 a c}+2 c x^n}\right )\right )+\left (-b^2+4 a c+b \sqrt {b^2-4 a c}\right ) \left (1-8^{-1/n} \left (\frac {c x^n}{b+\sqrt {b^2-4 a c}+2 c x^n}\right )^{-3/n} \, _2F_1\left (-\frac {3}{n},-\frac {3}{n};\frac {-3+n}{n};\frac {b+\sqrt {b^2-4 a c}}{b+\sqrt {b^2-4 a c}+2 c x^n}\right )\right )\right )+3 e x \left (\left (-b^2+4 a c-b \sqrt {b^2-4 a c}\right ) \left (1-\left (\frac {x^n}{-\frac {-b+\sqrt {b^2-4 a c}}{2 c}+x^n}\right )^{-2/n} \, _2F_1\left (-\frac {2}{n},-\frac {2}{n};\frac {-2+n}{n};\frac {b-\sqrt {b^2-4 a c}}{b-\sqrt {b^2-4 a c}+2 c x^n}\right )\right )+\left (-b^2+4 a c+b \sqrt {b^2-4 a c}\right ) \left (1-4^{-1/n} \left (\frac {c x^n}{b+\sqrt {b^2-4 a c}+2 c x^n}\right )^{-2/n} \, _2F_1\left (-\frac {2}{n},-\frac {2}{n};\frac {-2+n}{n};\frac {b+\sqrt {b^2-4 a c}}{b+\sqrt {b^2-4 a c}+2 c x^n}\right )\right )\right )+6 d \left (\left (-b^2+4 a c-b \sqrt {b^2-4 a c}\right ) \left (1-\left (\frac {x^n}{-\frac {-b+\sqrt {b^2-4 a c}}{2 c}+x^n}\right )^{-1/n} \, _2F_1\left (-\frac {1}{n},-\frac {1}{n};\frac {-1+n}{n};\frac {b-\sqrt {b^2-4 a c}}{b-\sqrt {b^2-4 a c}+2 c x^n}\right )\right )-2^{-1/n} \sqrt {b^2-4 a c} \left (-b+\sqrt {b^2-4 a c}\right ) \left (\frac {c x^n}{b+\sqrt {b^2-4 a c}+2 c x^n}\right )^{-1/n} \left (2^{\frac {1}{n}} \left (\frac {c x^n}{b+\sqrt {b^2-4 a c}+2 c x^n}\right )^{\frac {1}{n}}-\, _2F_1\left (-\frac {1}{n},-\frac {1}{n};\frac {-1+n}{n};\frac {b+\sqrt {b^2-4 a c}}{b+\sqrt {b^2-4 a c}+2 c x^n}\right )\right )\right )\right )}{12 a \left (-b^2+4 a c\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.02, size = 0, normalized size = 0.00 \[\int \frac {f \,x^{2}+e x +d}{a +b \,x^{n}+c \,x^{2 n}}\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {d + e x + f x^{2}}{a + b x^{n} + c x^{2 n}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int \frac {f\,x^2+e\,x+d}{a+b\,x^n+c\,x^{2\,n}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________